package cn.hist.hfp.repository;

import cn.hist.hfp.entity.Commodity;
import cn.hist.hfp.entity.CommodityProducer;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

@Repository
public interface CommodityRepository extends JpaRepository<Commodity, Integer> {

    Page<Commodity> findByType(String type, Pageable pageable);

    Page<Commodity> findByProducer(CommodityProducer producer, Pageable pageable);

    Page<Commodity> findByTypeAndProducer(String type, CommodityProducer producer, Pageable pageable);
}
